package pluginMain;

import java.util.logging.Logger;

import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;

public class DeliayGUI extends JavaPlugin {
	public final String PLUGIN_NAME = "RemiliaNetwork Deliay GUI";
	public final Logger CONSOLE_LOGGER = this.getLogger();
	
	public static DeliayGUI Maininstance = null;
	public static DialogManager ManagerInstance = null;
	private static DialogEvent MainListener = null;
	private ItemSelectDialog testDialog = null;
	
	public void LOGCONSOLE(String msg){
		CONSOLE_LOGGER.info(msg);
	}
	
	@Override
	public void onEnable(){
		Maininstance = this;
		ManagerInstance = new DialogManager();
		MainListener = new DialogEvent();
		
		getServer().getPluginManager().registerEvents(MainListener, this);
		
		LOGCONSOLE(PLUGIN_NAME + " has been started.");
	}
	
	@Override
	public void onDisable(){
		LOGCONSOLE(PLUGIN_NAME + " has been disabled.");
	}
	
	@Override
	public boolean onCommand(CommandSender sender, Command command, String label, String[] args){
		if(sender instanceof Player)
		if (args.length >= 0)if(args[0] == "test") {
			testDialog = new ItemSelectDialog("TestDialog", "Dialog");
			testDialog.addItem(1, new ItemStack(Material.WOOL, 2));
			testDialog.addItem(1, new ItemStack(Material.WOOL, 3));
			testDialog.openDialog((Player)sender);
			return true;
		}
		return false;
	}
	
}
